<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     base_default
 */

/**
 * @see Mage_Paypal_Block_Iframe
 * @var Mage_Paypal_Block_Iframe $this 
 */
?>
<div id="checkout-paypaliframe-load" class="authentication"></div>
<script type="text/javascript">
//<![CDATA[
Review.prototype.save = function() {
    if (checkout.loadWaiting!=false) return;
    checkout.setLoadWaiting('review');
    var params = Form.serialize(payment.form);
    if (this.agreementsForm) {
        params += '&'+Form.serialize(this.agreementsForm);
    }
    params.save = true;
    var request = new Ajax.Request(
        this.saveUrl,
        {
            method:'post',
            parameters:params,
            onComplete: function(transport) {
                if (transport) {
                    var response = transport.responseJSON || transport.responseText.evalJSON(true) || {};
                    if (response.error_messages) {
                        checkout.setLoadWaiting(false);
                    }
                }
            },
            onSuccess: this.onSave,
            onFailure: checkout.ajaxFailure.bind(checkout)
        }
    );
}
//]]>
</script>
